extends Node

@onready var level = 1

var scenes = {
	"main_menu": "res://scn/GameSelectStart/game_main.tscn",
	"load_game": "res://scn/map/LoadGame/load_game.tscn",
	"game_level": "res://scn/map/level/level_%s.tscn",
}

# 切换场景的方法
func change_scene(scene_name: String) -> void:
	# 检查场景是否存在
	if not scenes.has(scene_name):
		print("Error: Scene '%s' not found in the scenes dictionary." % scene_name)
		return
	
	# 获取场景路径
	var scene_path = scenes[scene_name]
	
	
	if scene_name == "game_level":
		scene_path = scene_path % [level]
	
	# 使用 Scene Manager 插件加载场景
	SceneManager.change_scene(scene_path)
